<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script src="./three.js"></script>
    <script>
        let scene = new THREE.Scene()
        let camera = new THREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,500)
        camera.position.z = 10

        let renderer = new THREE.WebGLRenderer()
        renderer.setSize(window.innerWidth,window.innerHeight)
        document.body.appendChild(renderer.domElement)

        let geometry = new THREE.BoxGeometry(1,1,1)
        let material = new THREE.MeshBasicMaterial({color:'red'})
        let cube = new THREE.Mesh(geometry,material)
        scene.add(cube)

        function render(){
            renderer.render(scene,camera)
            cube.rotation.z +=0.01
            cube.rotation.y +=0.01
            requestAnimationFrame(render)
        }

        render()
    </script>
</body>
</html>
